#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'tian'
__data__ = '2022/4/29 14:09'
# software: PyCharm


import json
import requests


class YunPian(object):

    def __init__(self, api_key):
        self.api_key = api_key
        self.single_send_url = "https://sms.yunpian.com/v2/sms/single_send.json"

    def send_sms(self, code, mobile):
        # 云片网api调用
        # params = {
        #     "apikey": self.api_key,
        #     "mobile": mobile,
        #     "text": "【暮学生鲜】您的验证码是{code}。如非本人操作，请忽略本短信".format(code=code)
        # }
        #
        # response = requests.post(self.single_send_url, data=params)
        # re_dict = json.loads(response.text)
        # print(re_dict)
        # return re_dict
        re_dict = {
            "code": 0,
        }
        return re_dict


if __name__ == "__main__":
    yun_obj = YunPian("d6c4ddbf50ab36611d2f52041a0b949e")
    yun_obj.send_sms("2017", "13580423620")
